home *** CD-ROM | disk | FTP | other *** search
- unit Ioprocs;
-
- interface
- (* Any procedures and functions which you want to be visible
- to other programs using this unit must be declared in the
- interface section. If you comment out the declartion between
- curly brackets {} and try to run the Edit2
- program, the compiler will report an error. *)
-
- function ThisFileExists(FileName: String): Boolean;
-
- implementation
- function ThisFileExists(FileName: String): Boolean;
- { Returns True if the file exists. Otherwise
- it returns False. You can get the same functionality
- from the FileExists function in the standard SysUtils
- unit. }
- var
- F: file;
- begin
- {$I-} { turn off IO checking }
- AssignFile(F, FileName); { Assign the file name }
- FileMode := 0; { Set file access to read only }
- Reset(F); { Try to open the file }
- CloseFile(F);
- {$I+} { Turn IO checking on again }
- { Test IOResult returned }
- ThisFileExists := (IOResult = 0) and (FileName <> '');
- end; { FileExists }
-
-
-
- end.
-